<template>
	<view class="my">
		<view class="my-header">
			<view class="my-header__bgc">
				<image :src="userInfo.avatar" mode="aspectFill"></image>
			</view>
			<view class="my-header__logo">
				<view class="my-header__logo-box">
					<image :src="userInfo.avatar" mode="aspectFill"></image>
					<text class="my-header__name">{{userInfo.author_name}}</text>
				</view>
			</view>
			<view class="my-header__info">
				<view class="my-header__info-box">
					<text class="my-header__info-title">被关注</text>
					<text>{{userInfo.follow_count}}</text>
				</view>
				<view class="my-header__info-box">
					<text class="my-header__info-title">粉丝</text>
					<text>{{userInfo.fans_count}}</text>
				</view>
				<view class="my-header__info-box">
					<text class="my-header__info-title">积分</text>
					<text>{{userInfo.integral_count || 0}}</text>
				</view>
			</view>
		</view>
		<view class="my-content">
			<view class="my-content__list" @click="open">
				<view class="my-content__list-title">
					<uni-icons class="icons" type="contact" size="16" color="#666"></uni-icons>
					<text>我的文章</text>
				</view>
				<uni-icons type="arrowright" size="14" color="#666"></uni-icons>
			</view>
			<view class="my-content__list" @click="feedback">
				<view class="my-content__list-title">
					<uni-icons class="icons" type="help" size="16" color="#666"></uni-icons>
					<text>意见反馈</text>
				</view>
				<uni-icons type="arrowright" size="14" color="#666"></uni-icons>
			</view>
		</view>
	</view>
</template>

<script>
	import {mapState} from 'vuex'
	export default {
		data() {
			return {
			}
		},
		computed: {
			...mapState(['userInfo'])
		},
		methods: {
			open() {
				uni.navigateTo({
					url: '/pages/my-article/my-article'
				})
			},
			feedback() {
				uni.navigateTo({
					url: '/pages/feedback/feedback'
				})
			},
		}
	}
</script>

<style lang="scss">
	page {
		height: 100%;
		display: flex;
	}
	.my {
		height: 100%;
		flex: 1;
		display: flex;
		flex-direction: column;
		box-sizing: border-box;
		.my-header {
			position: relative;
			height: 260px;
			width: 100%;
			display: flex;
			flex-direction: column;
			justify-content: space-between;
			align-items: center;
			.my-header__bgc {
				position: absolute;
				top: 0;
				left: 0;
				width: 100%;
				height: 100%;
				opacity: 0.3;
				filter:blur(10px);
				z-index: -1;
				image {
					width: 100%;
					height: 100%;
				}
			}
			.my-header__logo {
				margin-top: 30px;
				.my-header__logo-box {
					display: flex;
					flex-direction: column;
					justify-content: center;
					align-items: center;
					image {
						width: 50px;
						height: 50px;
						border-radius: 50%;
					}
					text {
						margin-top: 10px;
						font-size: 16px;
						font-weight: bold;
					}
				}
			}
			.my-header__info {
				width: 80%;
				display: flex;
				justify-content: space-between;
				margin-bottom: 15px;
				font-size: 14px;
				.my-header__info-box {
					display: flex;
					flex-direction: column;
					justify-content: center;
					align-items: center;
					padding: 0 10px;
					color: #666;
					.my-header__info-title {
						width: 80px;
						text-align: center;
					}
				}
			}
		}
		.my-content {
			height: 100%;
			display: flex;
			flex-direction: column;
			background-color: #F5F5F5;
			.my-content__list {
				height: 45px;
				padding: 0 10px;
				margin-bottom: 10px;
				background-color: #fff;
				display: flex;
				justify-content: space-between;
				align-items: center;
				.my-content__list-title {
					font-size: 14px;
					color: #666;
					.icons {
						margin-right: 10px;
					}
				}
			}
		}
	}
</style>
